#!/usr/bin/node

const http = require('http'),
      log = console.log,
      fs = require('fs');

http.createServer((req,res)=>{
  log(req.headers);
  
  let filename = __dirname + req.url;
  fs.readFile(filename,(err,data)=>{
    if(err){
      log(err.message);
      res.statusCode = 404;
      res.end(ree.message);
    }else{
      res.end(data);
    }
  });
)}.listen(8080);
